<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- 页面meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>科情服务 - 任务单详情</title>
<meta name="description" content="科情服务任务单">
<meta name="keywords" content="科情服务">

<!-- Tell the browser to be responsive to screen width -->
<meta
	content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
	name="viewport">

<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/ionicons/css/ionicons.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/iCheck/square/blue.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/morris/morris.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/datepicker/datepicker3.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.theme.default.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/select2/select2.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/adminLTE/css/AdminLTE.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/adminLTE/css/skins/_all-skins.min.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/style.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.skinNice.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/plugins/bootstrap-slider/slider.css">
</head>

<body class="hold-transition skin-blue sidebar-mini">

	<div class="wrapper">

		<!-- 页面头部 -->
		<jsp:include page="header.jsp"></jsp:include>
		<!-- 页面头部 /-->

		<!-- 导航侧栏 -->
		<jsp:include page="aside.jsp"></jsp:include>
		<!-- 导航侧栏 /-->

		<!-- 内容区域 -->
		<div class="content-wrapper">

			<!-- 内容头部 -->
			<section class="content-header">
			<h1>
				数据录入管理 <small>科情服务任务单详情</small>
			</h1>
			<ol class="breadcrumb">
				<li><a href="${pageContext.request.contextPath}/index.jsp"><i
						class="fa fa-dashboard"></i> 首页</a></li>
				<li><a
					href="${pageContext.request.contextPath}/kqfw/findTaskAdmin.do">数据录入管理</a></li>

				<li class="active">科情服务任务单详情</li>
			</ol>
			</section>
			<!-- 内容头部 /-->

			<!-- 正文区域 -->
			<section class="content"> <!-- .box-body -->
			<div class="box box-primary" style="margin-bottom: 0">
				<div class="box-header with-border text-center">
					<h3 class="box-title">科情服务任务单</h3>
					<button class="btn btn-default pull-right" data-toggle="modal" data-target="#tableModal">下载表格</button>
					<%--表格模态框--%>
					<div class="modal fade" id="tableModal" tabindex="-1" role="dialog" aria-labelledby="tableModalLabel" aria-hidden="true">
						<div class="modal-dialog"  style="width: 950px;">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									<h4 class="modal-title" id="tableModalLabel">科情服务任务单</h4>
								</div>

								<div class="modal-body" id="export_table">
									<table class="table table-bordered table-striped table-hover dataTable">
										<tbody>
											<tr>
												<td style="background: #d2d6de;">任务名称</td>
												<td colspan="3">${taskInfo.taskname}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">ID</td>
												<td>${taskInfo.id}</td>
												<td style="background: #d2d6de;">编号</td>
												<td>${taskInfo.number}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">单位</td>
												<td>${taskInfo.organization}</td>
												<td style="background: #d2d6de;">联系人</td>
												<td>${taskInfo.linkman}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">联系电话</td>
												<td>${taskInfo.organization}</td>
												<td style="background: #d2d6de;">下达时间</td>
												<td>${taskInfo.linkman}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">完成时限</td>
												<td>${taskInfo.organization}</td>
												<td style="background: #d2d6de;">任务类型</td>
												<td>${taskInfo.linkman}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">随机码</td>
												<td>${taskInfo.code}</td>
												<td style="background: #d2d6de;">任务单状态</td>
												<td>${taskInfo.statusStr}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">反馈资料地址</td>
												<td colspan="3">${taskInfo.means_url}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">中英文关键词</td>
												<td colspan="3">${taskInfo.keywords}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">任务背景</td>
												<td colspan="3">${taskInfo.taskbackground}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">任务简述</td>
												<td colspan="3">${taskInfo.taskmark}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;">具体要求</td>
												<td colspan="3">${taskInfo.specification}</td>
											</tr>
											<tr>
												<td style="background: #d2d6de;" rowspan="${fn:length(taskInfo.kqfwPerformance)+2}">任务完成情况</td>
												<td colspan="3">${taskInfo.taskInfo}</td>
											</tr>
											<tr>
												<td class="text-center">完成人</td>
												<td class="text-center">部职别</td>
												<td class="text-center">任务分工</td>
											</tr>
											<c:forEach items="${taskInfo.kqfwPerformance}" var="performance">
												<tr>
													<td>
														${performance.person_in_charge}
													</td>
													<td>
														${performance.level}
													</td>
													<td>
														${performance.task_allocation}
													</td>
												</tr>
											</c:forEach>
											<tr>
												<td style="background: #d2d6de;">任务反馈</td>
												<td colspan="3">${taskInfo.taskfeedback}</td>
											</tr>
										</tbody>
									</table>
								</div>
								<div class="modal-footer">
									<button type="button" class="btn btn-primary" onclick="exportword()">保存表格</button>
									<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								</div>
							</div>
						</div>
					</div>
					<%--新建模态框结束--%>

				</div>
			</div>
				<div class="panel panel-default">
					<div class="row data-type">
						<div class="col-md-2 title">任务名称</div>
						<div class="col-md-10 data">
							<input type="text" class="form-control" name="taskname" value="${taskInfo.taskname}" readonly="readonly">
						</div>

						<div class="col-md-2 title">ID</div>
						<div class="col-md-4 data">
							<input type="text" class="form-control" name="id" value="${taskInfo.id}" readonly="readonly">
						</div>
						<div class="col-md-2 title">编号</div>
						<div class="col-md-4 data">
							<input type="text" class="form-control" name="number" value="${taskInfo.number}" readonly="readonly">
						</div>
						<div class="col-md-2 title">单位</div>
						<div class="col-md-4 data">
							<input type="text" class="form-control" name="organization" value="${taskInfo.organization}" readonly="readonly">
						</div>
						<div class="col-md-2 title">联系人</div>
						<div class="col-md-4 data">
							<input type="text" class="form-control" name="linkman" value="${taskInfo.linkman}" readonly="readonly">
						</div>

						<div class="col-md-2 title">联系电话</div>
						<div class="col-md-4 data">
							<input type="text" class="form-control" name="telephone" value="${taskInfo.telephone}" readonly="readonly">
						</div>
						<div class="col-md-2 title">下达时间</div>
						<div class="col-md-4 data">
							<div class="input-group date">
								<div class="input-group-addon">
									<i class="fa fa-calendar"></i>
								</div>
								<input type="text" class="form-control pull-right"
									   id="datepicker-a3" name="givetime" value="${taskInfo.givetimeStr}" readonly="readonly">
							</div>
						</div>

						<div class="col-md-2 title">完成时限</div>
						<div class="col-md-4 data">
							<input type="text" class="form-control" name="timelimit" value="${taskInfo.timelimit}" readonly="readonly">
						</div>

						<div class="col-md-2 title">任务类型</div>
						<div class="col-md-4 data">
							<select class="form-control select2" style="width: 100%"
									name="tasktype" readonly="readonly">
								<option value="0" <c:if test="${taskInfo.tasktype==0}">selected</c:if>>资料收集</option>
								<option value="1" <c:if test="${taskInfo.tasktype==1}">selected</c:if>>科技查新</option>
								<option value="2" <c:if test="${taskInfo.tasktype==2}">selected</c:if>>前沿动态分析整编</option>
								<option value="3" <c:if test="${taskInfo.tasktype==3}">selected</c:if>>"信息专员"服务</option>
								<option value="4" <c:if test="${taskInfo.tasktype==4}">selected</c:if>>团队学术影响力分析</option>
								<option value="5" <c:if test="${taskInfo.tasktype==5}">selected</c:if>>其他</option>
							</select>
						</div>
						<div class="col-md-2 title">随机码</div>
						<div class="col-md-4 data">
							<input type="text" class="form-control" name="timelimit" value="${taskInfo.code}" readonly="readonly">
						</div>
						<div class="col-md-2 title">任务单状态</div>
						<div class="col-md-4 data">
							<c:if test="${taskInfo.status==1}">
								<input type="text" class="form-control" name="status" value="待处理" readonly="readonly">
							</c:if>
							<c:if test="${taskInfo.status==2}">
								<input type="text" class="form-control" name="status" value="待修改" readonly="readonly">
							</c:if>
							<c:if test="${taskInfo.status==3}">
								<input type="text" class="form-control" name="status" value="资料查找中" readonly="readonly">
							</c:if>
							<c:if test="${taskInfo.status==4}">
								<input type="text" class="form-control" name="status" value="已完成" readonly="readonly">
							</c:if>

						</div>

						<div class="col-md-2 title">反馈资料地址</div>
						<div class="col-md-10 data">
							<input type="text" class="form-control" name="keywords" value="${taskInfo.means_url}" readonly="readonly">
						</div>

						<div class="col-md-2 title">中英文关键词</div>
						<div class="col-md-10 data">
							<input type="text" class="form-control" name="keywords" value="${taskInfo.keywords}" readonly="readonly">
						</div>
						<div class="col-md-2 title rowHeight2x">任务背景</div>
						<div class="col-md-10 data rowHeight2x">
							<textarea class="form-control" rows="2" name="taskbackground" readonly="readonly">${taskInfo.taskbackground}</textarea>
						</div>
						<div class="col-md-2 title rowHeight2x">任务简述</div>
						<div class="col-md-10 data rowHeight2x">
							<textarea class="form-control" rows="2" name="taskmark" readonly="readonly">${taskInfo.taskmark}</textarea>
						</div>

						<div class="col-md-2 title rowHeight2x">具体要求</div>
						<div class="col-md-10 data rowHeight2x">
							<textarea class="form-control" rows="2" name="specification" readonly="readonly">${taskInfo.specification}</textarea>
						</div>
						<div class="col-md-2 title rowHeight6x">任务完成情况</div>
						<div class="col-md-10 data rowHeight6x">
							<textarea class="form-control" rows="3" name="taskInfo" readonly="readonly">${taskInfo.taskInfo}</textarea>
							<table class="table table-bordered table-striped table-hover dataTable">
								<thead>
								<tr>
									<th>ID</th>
									<th class="text-center">完成人</th>
									<th class="text-center">部职别</th>
									<th class="text-center">任务分工</th>
								</tr>
								</thead>
								<tbody>
								<c:forEach items="${taskInfo.kqfwPerformance}" var="performance">
									<tr>
										<td>
											<input type="text" class="form-control" name="pid" value="${performance.id}" readonly="readonly">
										</td>
										<td>
											<input type="text" class="form-control" name="person_in_charge" value="${performance.person_in_charge}" readonly="readonly">
										</td>
										<td>
											<input type="text" class="form-control" name="level" value="${performance.level}" readonly="readonly">
										</td>
										<td>
											<input type="text" class="form-control" name="task_allocation" value="${performance.task_allocation}" readonly="readonly">
										</td>
									</tr>
								</c:forEach>
								</tbody>
							</table>
						</div>
						<div class="col-md-2 title rowHeight2x">任务反馈</div>
						<div class="col-md-10 data rowHeight2x">
							<textarea class="form-control" rows="3" name="taskfeedback" readonly="readonly">${taskInfo.taskfeedback}</textarea>
						</div>

					</div>
				</div>
				<!--工具栏-->
				<div class="box-tools text-center">
					<button type="button" class="btn bg-default"
							onclick="history.back(-1);">返回</button>
				</div>
				<!--工具栏/-->
			</section>
			<!-- 正文区域 /-->

		</div>
		<!-- 内容区域 /-->
		<!-- 底部导航 -->
		<jsp:include page="footer.jsp"></jsp:include>
		<!-- 底部导航 /-->
	</div>

	<div id="showDIV" style="display: none">
		<style type="text/css">
			#printWord table{
				border: 1px solid #ddd;
				border-collapse: collapse;
				width: 95%;
				margin:auto;
			}

			#printWord table tbody tr td{
				border: 1px solid #ddd;
			}
			#printWord table thead tr th{
				border:1px solid #ddd;
				border-radius: 10px;
			}
			h4{
				font-family: "方正小标宋简体"
			}
			#printWord span{
				font-family: "楷体"
			}
			.IndexFooter span{
				font-family: "楷体"
			}
		</style>
		<h4 style="text-align: center;">科情服务任务单</h4>
		<div id="printWord">

		</div>
	</div>

	<script src="${pageContext.request.contextPath}/plugins/jQuery/jquery-2.2.3.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/jQueryUI/jquery-ui.min.js"></script>
	<script>
		$.widget.bridge('uibutton', $.ui.button);
	</script>
	<script src="${pageContext.request.contextPath}/plugins/bootstrap/js/bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/raphael/raphael-min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/morris/morris.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/sparkline/jquery.sparkline.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/knob/jquery.knob.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/daterangepicker/moment.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/datepicker/bootstrap-datepicker.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/slimScroll/jquery.slimscroll.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/fastclick/fastclick.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/iCheck/icheck.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/adminLTE/js/app.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/treeTable/jquery.treetable.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/select2/select2.full.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
	<script
		src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/markdown.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/bootstrap-markdown/js/to-markdown.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/ckeditor/ckeditor.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/input-mask/jquery.inputmask.extensions.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/datatables/dataTables.bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/chartjs/Chart.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.resize.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.pie.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/flot/jquery.flot.categories.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/ionslider/ion.rangeSlider.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/bootstrap-slider/bootstrap-slider.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/plugins/file/FileSaver.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/plugins/file/jquery.wordexport.js"></script>
	<script>
		$("#collapse-table").treetable({ expandable : true });
		$(document).ready(function() {
			// 选择框
			$(".select2").select2();

			// WYSIHTML5编辑器
			$(".textarea").wysihtml5({
				locale : 'zh-CN'
			});
			$("#collapse-table").treetable({
				expandable : true
			});
		});

		// 设置激活菜单
		function setSidebarActive(tagUri) {
			var liObj = $("#" + tagUri);
			if (liObj.length > 0) {
				liObj.parent().parent().addClass("active");
				liObj.addClass("active");
			}
		}
		//定义导出报表数据
		function exportword(){
			var myDate = new Date();
			$("#stm").html(myDate.toLocaleString());
			var htmlstr = $("#export_table").html();
			console.log(htmlstr);
			$("#printWord").html(htmlstr);
			$('#showDIV').wordExport("科情服务任务单"+myDate.toLocaleDateString());
			alert("表格保存成功！")
		}

		$(document).ready(function() {

			// 激活导航位置
			setSidebarActive("admin-datalist");

			// 列表按钮 
			$("#dataList td input[type='checkbox']").iCheck({
				checkboxClass : 'icheckbox_square-blue',
				increaseArea : '20%'
			});
			// 全选操作 
			$("#selall").click(function() {
				var clicks = $(this).is(':checked');
				if (!clicks) {
					$("#dataList td input[type='checkbox']").iCheck("uncheck");
				} else {
					$("#dataList td input[type='checkbox']").iCheck("check");
				}
				$(this).data("clicks", !clicks);
			});
		});
	</script>
</body>

</html>